package com.zny.sescore.exception;

import lombok.AllArgsConstructor;

@AllArgsConstructor
public enum MessageEnum implements IMsgEnum {

    INVALID_REQUEST(600, "invalid request", "非法请求"),
    BIZ_ERROR(500, "biz error", "系统业务异常"),
    BIZ_SUCCESS(200, "operation success", "操作成功"),
    UNAUTHORIZED(401, "auth error", "未登录或登录信息已过期"),
    INVALID_SIGN(700, "invalid sign", "非法签名"),
    PARAM_DECRYPT_FAIL(800, "param decrypt fail", "参数解密失败"),
    RESPONSE_ENCRYPT_FAIL(900, "response encrypt fail", "返回值加密失败"),
    SERVICE_BUSY(911, "service busy", "系统繁忙，请稍后重试"),

    // 100000-19999 为系统异常
    PARAM_ERROR(100000, "param error", "参数错误"),
    DATA_EMPTY(100001, "data empty", "数据不存在"),
    TOKEN_ERROR(100002, "token error", "token无效"),
    VALIDATE_FAIL(100003, "validate fail", "校验失败"),
    ID_CARD_ERROR(100004, "idCard error", "身份证错误"),
    PWD_INCORRECT(100005, "password error", "密码错误"),
    USER_NOT_EXIST(100006, "user not exist", "用户不存在"),
    ACCOUNT_ERROR(100007, "auth error", "用户名或密码错误"),
    ACCOUNT_REPEAT(100008, "account repeat", "用户已经存在"),
    ACCOUNT_INCORRECT(100009, "account error", "账户不存在"),
    VALIDATE_SUCCESS(100010, "validate success", "校验成功"),
    PASSWORD_ERROR(100011, "password error", "两次密码不相同"),
    VERIFY_CODE_ERROR(100012, "verify code error", "验证码错误"),
    GET_PROPERTY_ERROR(100013, "get property error", "获取属性配置异常"),
    PASSWORD_TOO_SIMPLE(100014, "password too simple", "您的密码复杂度太低（密码中必须包含字母、数字、特殊字符，长度至少8个字符）"),
    PARAM_VALIDATE_FAIL(100015, "param validate fail", "参数校验失败"),
    USER_NOT_PASS(100016, "user not pass", "用户未审核，请联系管理员进行审核"),
    USER_HAS_FORBIDDEN(100017, "user has forbidden", "用户已禁用，请联系管理员"),

    //200000-29999 为患者相关业务异常
    HIS_API_ERROR(200000, "his api error", "HIS接口调用失败"),
    PATIENT_NOT_EXIST(200001, "patient not exist", "患者不存在"),
    PATIENT_SAVE_ERROR(200002, "patient save error", "患者保存失败"),
    ZWB_PATIENT_EXIST(200003, "zwb patient exist", "治未病患者已经存在"),
    WARNING_EXP_ERROR(200004, "warning expression error", "预警规则表达式错误"),
    DEPARTMENT_NAME_DUPLICATE(200005, "department name duplicate", "科室名称重复"),
    PATIENT_MAIN_INFO_MISSING(200006, "patient main info missing", "患者主要信息缺失"),
    PATIENT_MEDICAL_INFORMATION_NOT_EXIST(200007, "patient medical information not exist", "患者就诊信息缺失"),
    MB_PATIENT_EXIST(200008, "mb patient exist", "患者已加入该疾病科室,不能重复加入"),
    APPLY_GROUP_EXIST(200009, "patient has applied", "患者已申请加入该慢病组，请等待通知"),
    APPLY_GROUP_PASS(200010, "patient in disease group", "患者已加入该慢病组"),
    ID_CARD_NOT_EXIST(200011, "id card not exist", "患者身份证号码为空"),
    PATIENT_NURSING_RECORD_NOT_EXIST(200012, "patient nursing record not exist", "患者历史病历不存在"),

    // 300000-39999 为档案相关业务异常
    DOSSIER_REPEAT(300001, "dossier repeat", "该科室已存在该患者的档案"),
    DOSSIER_SAVE_ERROR(300002, "dossier save error", "档案保存失败"),
    DOSSIER_CONTENT_SAVE_ERROR(300003, "dossier content save error", "档案内容保存失败"),
    GENERATE_FOLLOW_TASK_ERROR(300004, "generate follow task error", "生成待随访任务失败"),
    GENERATE_URGE_TASK_ERROR(300005, "generate urge task error", "生成待督导任务失败"),
    DOSSIER_NOT_EXIST(300006, "dossier not exist", "档案不存在"),
    DOSSIER_PATIENT_INFO_NOT_EXIST(300007, "dossier patient info not exist", "档案关联的患者信息不存在"),
    DOSSIER_PATIENT_ID_NOT_EXIST(300008, "dossier patient id not exist", "档案关联的患者ID不存在"),
    DOSSIER_UPDATE_ERROR(300009, "dossier update error", "档案信息修改失败"),
    DOSSIER_PATIENT_UPDATE_ERROR(300010, "dossier patient update error", "患者信息修改失败"),
    DOSSIER_CONTENT_UPDATE_ERROR(300011, "dossier content update error", "档案内容修改失败"),
    DOSSIER_CODE_NOT_EXIST(300012, "dossier code not exist", "档案编号不存在"),
    DOSSIER_CONTENT_REMOVE_ERROR(300013, "dossier content remove error", "档案内容删除失败"),
    DOSSIER_TEMPLATE_NOT_EXIST(300014, "dossier template not exist", "档案模板不存在"),
    SAVE_OR_UPDATE_TEMPLATE_ERROR(300015, "save or update template error", "保存或修改档案模板失败"),
    DEPARTMENT_ID_NOT_EXIST(300016, "department id not exist", "departmentId不存在!"),
    SEQ_NO_UPDATE_ERROR(300017, "seq no update error", "seqNo修改失败"),
    DISEASE_INFO_NOT_EXIST(300018, "disease info not exist", "病种信息不存在"),
    DEPARTMENT_INFO_NOT_EXIST(300019, "department info not exist", "科室信息不存在"),
    DOSSIER_TEMPLATE_REPEAT(300020, "dossier template repeat", "档案模板已存在"),
    DOSSIER_TEMPLATE_NO_NEED_UPDATE(300021, "dossier template no need update", "标题和内容未改变，无需修改"),
    GENERATE_PDF_ERROR(300022, "generate pdf error", "生成PDF失败"),
    GENERATE_QR_CODE_ERROR(300023, "generate qr code error", "生成微信二维码失败"),
    NO_NEED_REPEAT_REMOVE(300024, "no need repeat remove", "已删除, 无需重复删除"),
    TEMPLATE_CONTENT_CANNOT_BE_EMPTY(300024, "template content cannot be empty", "请至少新增一个模块"),


    // 500000-59999 为评估相关业务异常
    ASSESS_ID_NOT_EXIST(400000, "assess id not exist", "疾病评估id不存在"),
    ASSESS_CONFIG_ERROR(400001, "assess config error", "疾病评估配置错误"),
    ASSESS_PARAM_ERROR(400002, "assess param error", "疾病评估参数错误"),


    // 400000-49999 为待随访待督导相关业务异常
    TASK_IS_EXIST(400000, "task is exist", "任务已存在"),
    TASK_DELETE_ERROR(400001, "task delete error", "任务删除失败"),
    AUTO_TASK_CLOSED(400002, "auto task closed", "自动生成任务已关闭"),
    TASK_GENERATE_ERROR(400003, "task generate error", "任务生成失败"),
    FOLLOW_TASK_TYPE_ERROR(400004, "task type error", "随访任务类型错误"),
    FOLLOW_OR_URGE_TIME_NOT_FOUND(400005, "follow or urge time not found", "待随访或待督导时间未设置"),
    FOLLOW_TASK_STATUS_UPDATE_ERROR(400006, "follow task status update error", "待随访任务状态修改失败"),

    // 医生异常
    DOCTOR_NOT_EXIST(500001, "doctor not exist", "请联系信息科维护您的医生信息!"),

    // 问卷异常
    QUESTIONNAIRE_NOT_EXIST(600001, "questionnaire not exist", "问卷不存在!"),

    // 疾病预警异常
    WARNING_RULE_ALREADY_EXIST(700001, "this warning rule already exist", "此预警规则已存在!"),
    // 900000-99999 为社区相关业务异常
    PUSH_PATIENT_ALREADY_EXIST(900001, "push_patient_already_exist", "患者已推送至社区"),
    CONSULT_DIAGNOSIS_NOT_EXIST(900002, "consult diagnosis not exist", "会诊诊断不能为空"),
    CONSULT_SUGGESTION_NOT_EXIST(900003, "consult suggestion not exist", "会诊建议不能为空"),
    IP_ERROR(90004, "ip format error", "ip地址格式错误！");

    private final Integer code;
    private final String name;
    private final String displayName;

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public String getDisplayName() {
        return displayName;
    }

}